import axios from 'axios';

let instance = axios.create({
  timeout: 10000,
});
instance.interceptors.request.use(
  function (config) {
    // 加token;加loading
    return config;
  },
  function (error) {
    return Promise.reject(error);
  }
);
instance.interceptors.response.use(
  function (response) {
    return response.data;
  },
  function (error) {
    return Promise.reject(error);
  }
);

export default instance;
